import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";

import "./assets/css/reset.less";
import "element-plus/dist/index.css";

// 引入所有的图标
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

import VueMarkdownEditor from "@kangc/v-md-editor";
import "@kangc/v-md-editor/lib/style/base-editor.css";
import vuepressTheme from "@kangc/v-md-editor/lib/theme/vuepress.js";
import "@kangc/v-md-editor/lib/theme/style/vuepress.css";

import Prism from "prismjs";

VueMarkdownEditor.use(vuepressTheme, {
  Prism,
});

const app = createApp(App);

for (const [key, component] of (Object as any).entries(ElementPlusIconsVue)) {
  // 全局注册图标组件
  app.component(key, component);
}

app.use(VueMarkdownEditor);

app.use(createPinia());
app.use(router);

app.mount("#app");
